﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Transfer_Request.aspx.cs"
    Inherits="School.Pages.Admission.Transfer_Request" MasterPageFile="~/MasterALSafa.Master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <contenttemplate>
            <div align="center" dir="rtl">
                <asp:Panel ID="pnlAdd" runat="server" Visible="false">
                    <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td colspan="4">
                                <asp:Panel ID="pnlbasicadd" runat="server" Visible="true">
                                    <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td colspan="4" class="admintitle">
                                                ادخال بيانات
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                التاريخ
                                            </td>
                                            <td align="right">
                                                <asp:TextBox ID="txtDate" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                                <asp:CalendarExtender ID="txtDate_CalendarExtender" runat="server" Enabled="True"
                                                    TargetControlID="txtDate">
                                                </asp:CalendarExtender>
                                            </td>
                                            <td>
                                                <asp:Label ID="Label1" runat="server" CssClass="lab" Text="المجمع"></asp:Label>
                                            </td>
                                            <td align="right">
                                                <asp:DropDownList ID="ddlcampus_Id" runat="server" OnSelectedIndexChanged="ddlcampus_Id_SelectedIndexChanged"
                                                    AutoPostBack="True" Width="200px">
                                                </asp:DropDownList>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddlcampus_Id"
                                                    CssClass="required" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblFirstname" runat="server" CssClass="lab" Text="الاسم الاول"></asp:Label>
                                            </td>
                                            <td align="right">
                                                <asp:TextBox ID="txtFirstName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="req_valid_txtFirstName" runat="server" ControlToValidate="txtFirstName"
                                                    CssClass="required" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblCertificate_Id" runat="server" CssClass="lab" Text="نوع الشهادة"></asp:Label>
                                            </td>
                                            <td align="right">
                                                <asp:DropDownList ID="ddlCertificate_Id" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCertificate_Id_SelectedIndexChanged"
                                                    Width="200px" Enabled="False">
                                                </asp:DropDownList>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlCertificate_Id"
                                                    CssClass="required" Display="Dynamic" ErrorMessage="*"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblSecondName" runat="server" Text="الاسم الثاني" CssClass="lab"></asp:Label>
                                            </td>
                                            <td align="right">
                                                <asp:TextBox ID="txtSecondName" runat="server" Width="150px" CssClass="text"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="req_valid_txtSecondName" runat="server" Display="Dynamic"
                                                    ControlToValidate="txtSecondName" ErrorMessage="*" CssClass="required"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblStage_Id" runat="server" CssClass="lab" Text="مرحلة القيد"></asp:Label>
                                            </td>
                                            <td align="right">
                                                <asp:DropDownList ID="ddlStage_Id" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlStage_Id_SelectedIndexChanged"
                                                    Width="200px" Enabled="False">
                                                </asp:DropDownList>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" Display="Dynamic"
                                                    ControlToValidate="ddlStage_Id" ErrorMessage="*" CssClass="required"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblThirdName" runat="server" Text="الاسم الثالث" CssClass="lab"></asp:Label>
                                            </td>
                                            <td align="right">
                                                <asp:TextBox ID="txtThirdName" runat="server" Width="150px" CssClass="text"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic"
                                                    ControlToValidate="txtThirdName" ErrorMessage="*" CssClass="required"></asp:RequiredFieldValidator>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblGrade_Id" runat="server" Text="الصف" CssClass="lab"></asp:Label>
                                            </td>
                                            <td align="right">
                                                <asp:DropDownList ID="ddlGrade_Id" runat="server" AutoPostBack="True" Width="200px"
                                                    Enabled="False">
                                                </asp:DropDownList>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" Display="Dynamic"
                                                    ControlToValidate="ddlGrade_Id" ErrorMessage="*" CssClass="required"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblFourthName" runat="server" Text="الاسم الرابع" CssClass="lab"></asp:Label>
                                            </td>
                                            <td align="right" colspan="3">
                                                <asp:TextBox ID="txtFourthName" runat="server" Width="150px" CssClass="text"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4">
                                                <asp:Button ID="btnSave" runat="server" CssClass="graybutton" OnClick="btnSave_Click"
                                                    Text="حفظ طلب التحويل" />
                                                &nbsp;<asp:Button ID="btnCancel" runat="server" CssClass="graybutton" CausesValidation="False"
                                                    OnClick="btnCancel_Click" Text="تفريغ الحقول" />
                                                &nbsp;<asp:Button ID="btnend" runat="server" CssClass="graybutton" CausesValidation="False"
                                                    OnClick="btnend_Click" Text="انهاء" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4">
                                                &nbsp;
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="4" align="right">
                                                <asp:Button ID="btnXSchooltransferrequest" runat="server" Text="اضافة مدارس سابقة"
                                                    OnClick="btnXSchooltransferrequest_Click" CssClass="graybutton" />
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <asp:Panel ID="pnlAddNewXSchools" runat="server" Visible="false">
                                    <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td>
                                                <fieldset>
                                                    <legend>المدراس السابقة</legend>
                                                    <table width="80%" align="center" cellpadding="0" cellspacing="0" border="0" class="table_text">
                                                        <tr>
                                                            <td width="114">
                                                                <asp:Label Width="80" ID="lblSatrtDate" runat="server" Text="من" CssClass="lableface"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtSatrtDate" runat="server" Width="150px"></asp:TextBox>
                                                                <asp:CalendarExtender ID="txtSatrtDate_CalendarExtender" runat="server" Enabled="True"
                                                                    TargetControlID="txtSatrtDate">
                                                                </asp:CalendarExtender>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtSatrtDate"
                                                                    Display="Dynamic" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label Width="80" ID="lblEndDate" runat="server" Text="الى" CssClass="lableface"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtEndDate" runat="server" Width="150px"></asp:TextBox>
                                                                <asp:CalendarExtender ID="txtEndDate_CalendarExtender" runat="server" Enabled="True"
                                                                    TargetControlID="txtEndDate">
                                                                </asp:CalendarExtender>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtEndDate"
                                                                    Display="Dynamic" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label Width="80px" ID="lblSchoolName" runat="server" Text="المدرسة" CssClass="lableface"
                                                                    Height="27px"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtSchoolName" runat="server" Width="250px"></asp:TextBox>
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtSchoolName"
                                                                    Display="Dynamic" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label Width="80" ID="lblAddress" runat="server" Text="العنوان" CssClass="lableface"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:TextBox ID="txtAddress" runat="server" Width="250px"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label Width="80" ID="lblCertification" runat="server" Text="الشهادة" CssClass="lableface"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:DropDownList ID="ddlCertification" runat="server" Width="150px" AutoPostBack="True"
                                                                    OnSelectedIndexChanged="ddlCertification_SelectedIndexChanged">
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label Width="80" ID="lblGrade" runat="server" Text="المرحلة" CssClass="lableface"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:DropDownList ID="ddlGrade" runat="server" Width="150px" AutoPostBack="True"
                                                                    OnSelectedIndexChanged="ddlGrade_SelectedIndexChanged">
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label Width="80" ID="lblClass" runat="server" Text="الصف" CssClass="lableface"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:DropDownList ID="ddlsatge" runat="server" Width="150px" Enabled="False">
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label Width="80" ID="lblFirstLanguage" runat="server" Text="اللغة الاولى" CssClass="lableface"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:DropDownList ID="ddlFirstLanguage" runat="server" Width="150px">
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <asp:Label Width="80" ID="lblSecondLanguage" runat="server" Text="اللغة الثانية"
                                                                    CssClass="lableface"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:DropDownList ID="ddlSecondLanguage" runat="server" Width="150px">
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2">
                                                                <asp:Button ID="btnaddtogrid" runat="server" Text="اضافة مدرسة" CssClass="graybutton"
                                                                    OnClick="btnaddtogrid_Click" />
                                                                &nbsp;<asp:Button ID="btncancelxschool" runat="server" Text="انهاء" CssClass="graybutton"
                                                                    OnClick="btncancelxschool_Click" CausesValidation="False" />
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2">
                                                                <asp:GridView ID="griddataxschools" runat="server" Width="100%" OnRowCommand="griddataxschools_RowCommand"
                                                                    DataKeyNames="id" OnRowDataBound="griddataxschools_RowDataBound" CssClass="Grid">
                                                                    <Columns>
                                                                        <asp:TemplateField ShowHeader="False">
                                                                            <ItemTemplate>
                                                                                <asp:LinkButton ID="LnkDelete" runat="server" CausesValidation="False" CommandName="OnDelete"
                                                                                    Text="Delete"></asp:LinkButton>
                                                                            </ItemTemplate>
                                                                        </asp:TemplateField>
                                                                    </Columns>
                                                                </asp:GridView>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </fieldset>
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
            <br />
            <div align="center">
                <asp:Panel ID="pnlbrows" runat="server" Visible="true">
                    <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td colspan="2" class="admintitle">
                                البحث في الطلبات المقدمة
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <table width="90%" align="center" cellpadding="0" cellspacing="0" border="0">
                                   
                                    <tr>
                                        <td>
                                            التاريخ
                                        </td>
                                        <td align="right">
                                            <asp:TextBox ID="txtSearchDate" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                            <asp:CalendarExtender ID="txtSearchDate_CalendarExtender" runat="server" Enabled="True"
                                                TargetControlID="txtSearchDate">
                                            </asp:CalendarExtender>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label15" runat="server" CssClass="lab" Text="المجمع"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:DropDownList ID="ddlSearchcampus_Id" runat="server" AutoPostBack="True" Width="200px"
                                                OnSelectedIndexChanged="ddlSearchcampus_Id_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblFirstname0" runat="server" CssClass="lab" Text="الاسم الاول"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:TextBox ID="txtSearchFirstName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblCertificate_Id0" runat="server" CssClass="lab" Text="نوع الشهادة"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:DropDownList ID="ddlSearchCertificate_Id" runat="server" AutoPostBack="True"
                                                Width="200px" Enabled="False" OnSelectedIndexChanged="ddlSearchCertificate_Id_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblSecondName0" runat="server" CssClass="lab" Text="الاسم الثاني"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:TextBox ID="txtSearchSecondName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblStage_Id0" runat="server" CssClass="lab" Text="مرحلة القيد"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:DropDownList ID="ddlSearchStage_Id" runat="server" AutoPostBack="True" Width="200px"
                                                Enabled="False" OnSelectedIndexChanged="ddlSearchStage_Id_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblThirdName0" runat="server" CssClass="lab" Text="الاسم الثالث"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:TextBox ID="txtSearchThirdName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:Label ID="lblGrade_Id0" runat="server" CssClass="lab" Text="الصف"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:DropDownList ID="ddlSearchGrade_ID" runat="server" AutoPostBack="True" Width="200px"
                                                Enabled="False">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblFourthName0" runat="server" CssClass="lab" Text="الاسم الرابع"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:TextBox ID="txtSearchFourthName" runat="server" CssClass="text" Width="150px"></asp:TextBox>
                                        </td>
                                        <td>
                                            &nbsp;
                                        </td>
                                        <td align="right">
                                            &nbsp;
                                            <asp:CheckBox ID="cbStatus" runat="server" Text="عرض طلبات التحويل التي تم الموافقة عليها"
                                                AutoPostBack="True" OnCheckedChanged="cbStatus_CheckedChanged" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4" align="center">
                                            <asp:Button ID="btnSearch" runat="server" Text="بحث" CssClass="graybutton" OnClick="btnSearch_Click" />&nbsp;<asp:Button
                                                ID="btnAdd" runat="server" CssClass="graybutton" OnClick="btnAdd_Click" Text="اضافة جديد" />
                                            &nbsp;<asp:Button ID="btnGetAll" runat="server" Text="الكل" CssClass="graybutton"
                                                OnClick="btnGetAll_Click" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="text-align: right" colspan="4">
                                            <asp:Label CssClass="lableface" ID="lblRecordNo" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <asp:GridView Width="100%" AllowPaging="True" AllowSorting="True" ID="griddata" runat="server"
                                                CssClass="Grid" HeaderStyle-CssClass="GridHeaderFooter" FooterStyle-CssClass="GridHeaderFooter"
                                                PagerStyle-CssClass="GridPager" AlternatingRowStyle-CssClass="GridItemAltername"
                                                AutoGenerateColumns="False"
                                                DataKeyNames="Id" OnRowDataBound="griddata_RowDataBound" OnPageIndexChanging="griddata_PageIndexChanging"
                                                OnRowCommand="griddata_RowCommand">
                                                <AlternatingRowStyle CssClass="GridItemAltername" />
                                                <Columns>
                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lbltrid" runat="server" Visible="false" Text='<%# Bind("Id") %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="Date" HeaderText="تاريخ تقديم الطلب" DataFormatString="{0:d}" />
                                                    <asp:TemplateField HeaderText="الاسم الكامل">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("FirstName").ToString() + " " + Eval("SecondName").ToString() + " " + Eval("ThirdName").ToString()+ " " + Eval("FourthName").ToString() %>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                   
                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="CheckBox1" runat="server" Checked="true" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField Visible="false">
                                                        <ItemTemplate>
                                                            <asp:Button ID="btncreatpaymantandprint" runat="server" Text="امر دفع" CssClass="graybutton"
                                                                CommandName="paymant"  />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <FooterStyle CssClass="GridHeaderFooter" />
                                                <HeaderStyle CssClass="GridHeaderFooter" />
                                                <PagerStyle CssClass="GridPager" />
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            <asp:Label CssClass="error" ID="lblMessage" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4" align="right">
                                            &nbsp;
                                            <asp:Button ID="btnAccept" runat="server" Text="قبول" CssClass="graybutton" OnClick="btnAccept_Click" />&nbsp;
                                            <asp:Button ID="btnReject" runat="server" Text="رفض " CssClass="graybutton" OnClick="btnReject_Click" />&nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
            <br />


        </contenttemplate>
</asp:Content>
